﻿using ZK.MyControl;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ZK.Client
{
    public partial class FrmMessageBox : Form
    {
        public FrmMessageBox()
        {
            InitializeComponent();
            this.Resize += FrmMessageBox_Resize;
        }

        static FrmMessageBox frmMessageBox = new FrmMessageBox();

        private void FrmMessageBox_Load(object sender, EventArgs e)
        {
          



        }

        private void FrmMessageBox_Resize(object sender, EventArgs e)
        {
            SetWindowRegion.SetWindowSadius(20, this);
        }


        public static bool ShowCheck(string mes )
        {
            frmMessageBox.lblMes.Text = mes;

            frmMessageBox.btnSure.Visible = false;
            frmMessageBox.btnOK.Visible = true;
            frmMessageBox.btnCancel.Visible = true;
            if (frmMessageBox.ShowDialog() == DialogResult.OK)
            {
                return true;
            }
            else {
                return false;
            }
        }


        public static bool ShowTip(string mes)
        {
            frmMessageBox.lblMes.Text = mes;

            frmMessageBox.btnSure.Visible = true;
            frmMessageBox.btnOK.Visible = false;
            frmMessageBox.btnCancel.Visible = false;
            if (frmMessageBox.ShowDialog() == DialogResult.OK)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Hide();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Hide();
        }

        private void btnSure_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Hide();
        }
    }
}
